package com.example.demo.entity;

import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 心理问答中一条问题下的留言
 * </p>
 *
 * @author hyb
 * @since 2024-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Message implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 留言id
     */
    private Integer messageId;

    /**
     * 留言文本
     */
    private String text;

    /**
     * 留言发布者id
     */
    private Integer creatorId;

    /**
     * 所属问题id
     */
    private Integer issueId;

    /**
     * 记录最后更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 留言发布时间
     */
    private LocalDateTime createTime;
    public Message(Integer messageId, String text, Integer creatorId, Integer issueId) {
        this.messageId = messageId;
        this.text = text;
        this.creatorId = creatorId;
        this.issueId = issueId;
        this.updateTime = LocalDateTime.now();
        this.createTime = LocalDateTime.now();
    }


}
